import request from '@/utils/request';
import { OrderReviewQuery, OrderReviewVO, OrderReviewForm } from './types';

// 查询订单评价列表
export function listOrderReview(query: OrderReviewQuery) {
  return request({
    url: '/order/orderReview/list',
    method: 'get',
    params: query
  });
}

// 查询订单评价详细
export function getOrderReview(id: number) {
  return request({
    url: `/order/orderReview/${id}`,
    method: 'get'
  });
}

// 新增订单评价
export function addOrderReview(data: OrderReviewForm) {
  return request({
    url: '/order/orderReview',
    method: 'post',
    data: data
  });
}

// 修改订单评价
export function updateOrderReview(data: OrderReviewForm) {
  return request({
    url: '/order/orderReview',
    method: 'put',
    data: data
  });
}

// 删除订单评价
export function delOrderReview(ids: number[]) {
  return request({
    url: `/order/orderReview/${ids}`,
    method: 'delete'
  });
}

// 查询订单评价列表（不分页）
export function listOrderReviewAll(query: OrderReviewQuery) {
  return request({
    url: '/order/orderReview/listOrderReview',
    method: 'get',
    params: query
  });
}
